﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BloodBot
{
    class EnemyManager
    {
        List<Enemy> enemies;

        SpriteFont font;
        Game game;
        Color enemyColor = Color.Red;
        Collisions collisions;
        private Map map;

        public EnemyManager(Game game, Map map)
        {
            this.game = game;
            this.map = map;
        }

        public void Initialize()
        {
            enemies = new List<Enemy>();
            collisions = new Collisions(game);
            font = game.Content.Load<SpriteFont>("myFont");
            // load default enemy from config here?
        }

        public void SpawnNewEnemy(Vector3 enemyPosition, float enemySize, int enemyIndexNo, BasicEffect enemyEffect, SpriteBatch spriteBatch)
        {
            Pathfinding pathfinding = new Pathfinding(map);
            Enemy enemy = new Enemy(game, enemyPosition, enemySize, enemyIndexNo, enemyEffect, font, spriteBatch, pathfinding);
            enemy.Initialize();
            enemy.Load(collisions);
            enemies.Add(enemy);
        }

        public void RemoveEnemy(Enemy enemy)
        {
            enemies.Remove(enemy);
        }

        public List<Enemy> GetEnemies()
        {
            return enemies;
        }

        public Collisions GetCollisions()
        {
            return collisions;
        }


    }
}
